/**
 */
package de.thwildau.tm.moses.asn1.asn1.impl;

import de.thwildau.tm.moses.asn1.asn1.Asn1Package;
import de.thwildau.tm.moses.asn1.asn1.IntersectionElements;
import de.thwildau.tm.moses.asn1.asn1.Intersections;

import java.util.Collection;

import org.eclipse.emf.common.notify.NotificationChain;

import org.eclipse.emf.common.util.EList;

import org.eclipse.emf.ecore.EClass;
import org.eclipse.emf.ecore.InternalEObject;

import org.eclipse.emf.ecore.impl.MinimalEObjectImpl;

import org.eclipse.emf.ecore.util.EObjectContainmentEList;
import org.eclipse.emf.ecore.util.InternalEList;

/**
 * <!-- begin-user-doc -->
 * An implementation of the model object '<em><b>Intersections</b></em>'.
 * <!-- end-user-doc -->
 * <p>
 * The following features are implemented:
 * <ul>
 *   <li>{@link de.thwildau.tm.moses.asn1.asn1.impl.IntersectionsImpl#getIntersectionElements <em>Intersection Elements</em>}</li>
 * </ul>
 * </p>
 *
 * @generated
 */
public class IntersectionsImpl extends MinimalEObjectImpl.Container implements Intersections
{
  /**
   * The cached value of the '{@link #getIntersectionElements() <em>Intersection Elements</em>}' containment reference list.
   * <!-- begin-user-doc -->
   * <!-- end-user-doc -->
   * @see #getIntersectionElements()
   * @generated
   * @ordered
   */
  protected EList<IntersectionElements> intersectionElements;

  /**
   * <!-- begin-user-doc -->
   * <!-- end-user-doc -->
   * @generated
   */
  protected IntersectionsImpl()
  {
    super();
  }

  /**
   * <!-- begin-user-doc -->
   * <!-- end-user-doc -->
   * @generated
   */
  @Override
  protected EClass eStaticClass()
  {
    return Asn1Package.Literals.INTERSECTIONS;
  }

  /**
   * <!-- begin-user-doc -->
   * <!-- end-user-doc -->
   * @generated
   */
  public EList<IntersectionElements> getIntersectionElements()
  {
    if (intersectionElements == null)
    {
      intersectionElements = new EObjectContainmentEList<IntersectionElements>(IntersectionElements.class, this, Asn1Package.INTERSECTIONS__INTERSECTION_ELEMENTS);
    }
    return intersectionElements;
  }

  /**
   * <!-- begin-user-doc -->
   * <!-- end-user-doc -->
   * @generated
   */
  @Override
  public NotificationChain eInverseRemove(InternalEObject otherEnd, int featureID, NotificationChain msgs)
  {
    switch (featureID)
    {
      case Asn1Package.INTERSECTIONS__INTERSECTION_ELEMENTS:
        return ((InternalEList<?>)getIntersectionElements()).basicRemove(otherEnd, msgs);
    }
    return super.eInverseRemove(otherEnd, featureID, msgs);
  }

  /**
   * <!-- begin-user-doc -->
   * <!-- end-user-doc -->
   * @generated
   */
  @Override
  public Object eGet(int featureID, boolean resolve, boolean coreType)
  {
    switch (featureID)
    {
      case Asn1Package.INTERSECTIONS__INTERSECTION_ELEMENTS:
        return getIntersectionElements();
    }
    return super.eGet(featureID, resolve, coreType);
  }

  /**
   * <!-- begin-user-doc -->
   * <!-- end-user-doc -->
   * @generated
   */
  @SuppressWarnings("unchecked")
  @Override
  public void eSet(int featureID, Object newValue)
  {
    switch (featureID)
    {
      case Asn1Package.INTERSECTIONS__INTERSECTION_ELEMENTS:
        getIntersectionElements().clear();
        getIntersectionElements().addAll((Collection<? extends IntersectionElements>)newValue);
        return;
    }
    super.eSet(featureID, newValue);
  }

  /**
   * <!-- begin-user-doc -->
   * <!-- end-user-doc -->
   * @generated
   */
  @Override
  public void eUnset(int featureID)
  {
    switch (featureID)
    {
      case Asn1Package.INTERSECTIONS__INTERSECTION_ELEMENTS:
        getIntersectionElements().clear();
        return;
    }
    super.eUnset(featureID);
  }

  /**
   * <!-- begin-user-doc -->
   * <!-- end-user-doc -->
   * @generated
   */
  @Override
  public boolean eIsSet(int featureID)
  {
    switch (featureID)
    {
      case Asn1Package.INTERSECTIONS__INTERSECTION_ELEMENTS:
        return intersectionElements != null && !intersectionElements.isEmpty();
    }
    return super.eIsSet(featureID);
  }

} //IntersectionsImpl
